<template>
  <div class="v-editor-value-specification g-flex">
    <span class="g-pd-l-8 g-flex-1">
      {{ row.valueSpecificationInfo?.value }}
    </span>
    <div class="g-pd-r-4 g-flex-0">
      <img
        src="statics/icons/app/iconmore.png"
        class="g-pointer"
        @click="handleTimeClick(row)"
      />
    </div>
  </div>
</template>
<script lang="ts" setup>
import { actionManager } from "@/action/ActionManager";
import { PropertyRow } from "../../types";
import { ActionKey } from "@/action/ActionKey";
import { modelService } from "@/modules/model/service";
import { ShowAttributeAction } from "@/modules/model/actions/common/ShowAttributeAction";
import { AttributeTabKey } from "@/constants/Enums";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const props = defineProps<{
  row: PropertyRow;
}>();

const handleTimeClick = async (item: PropertyRow) => {
  // let attributeActionS:ModelData = {}
  console.log("item", item.value);
  const projectId = app.activeProject!.config.id;
  const { model } = await modelService.getModelDataForTabs(projectId, item.value as string);
  (actionManager.getAction(ActionKey.showAttribute) as ShowAttributeAction).run(model, AttributeTabKey.Properties);
};
</script>
